<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $page_title?></title>
<link href="<?php echo base_url(); ?>images/icono.ico"
	rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" type="text/css"
	href="<?php echo base_url(); ?>css/registrate.css">
<link rel="stylesheet" type="text/css"
	href="<?php echo base_url(); ?>css/tabs.css">

<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.min.js"></script>
<script type="text/javascript">
			function cambiaDocumento (select) {
				var selectedOption = select.options[select.selectedIndex];
				//alert ("The selected option is " + selectedOption.value);
				$('#doc').load('cargarDocumento?cbxDocumento='+selectedOption.value);
			}		
		
			function cambiaProvincia (select) {
    			var selectedOption = select.options[select.selectedIndex];
        		//alert ("The selected option is " + selectedOption.value);
        		$('#pro').load('cargarProvincia?cbxDepartamento='+selectedOption.value);
    		} 

    		function cambiaDistrito () {
    			/*
    	    	 * 02/06/2015
    	    	 se llamo a provincia y departamento por medio de variables y luego
    	    	 se las paso a la funcion cargarDistrito 	 
    	    	 */
    			var prov = document.Rproveedor.cbxProvincia.value;  
    			var dept = document.Rproveedor.cbxDepartamento.value;     		
        		$('#dis').load('cargarDistrito?prov='+prov+'&dept='+dept);
    		}  

    		function justNumbers(e){
    			var keynum = window.event ? window.event.keyCode : e.which;
            	if ((keynum == 8) || (keynum == 46))
    				return true;
             	return /\d/.test(String.fromCharCode(keynum));
            }
		</script>

</head>
<body>

	<div class="flex-container">
		<div>
			<img class="barra"
				src="<?php echo base_url();?>images/repuestock.png" />
		</div>
		<div>
			<img class="barra" src="<?php echo base_url();?>images/red.png" />
		</div>
	</div>

	<section id="main">

		<article class="module width_full">
			<header>
				<h3><?= $page_title ?></h3>
			</header>
			<div class="module_content" id="contenido">
						<?
						
						if (isset ( $logo ))
							echo "<center><img src='" . base_url () . "images/bienvenido.png' height='225' width='500'></center>";
						?>
		
	
	<div class="formulario">
					<form name="editar"
						action="<?php echo base_url(); ?>index.php/responsable/editar"
						method="POST">
						<table>
							<tr>
								<td><label>Nombres:</label></td>
								<td><input type="text" name="txtNombres" size="50"
									title="Letras y espacios en blanco. NO incluir tildes, el caracter ñ y minusculas"
									pattern="[a-zA-Z ]{2,40}" maxlength="40"
									onkeyup="javascript:this.value=this.value.toUpperCase()"
									required value="<?= $responsable[0]->nombres ?>"></td>
							</tr>
							<tr>
								<td><label>Apellidos:</label></td>
								<td><input type="text" name="txtApellidos" size="50"
									title="Letras y espacios en blanco. NO incluir tildes, el caracter ñ y minusculas"
									pattern="[a-zA-Z ]{2,40}" maxlength="40"
									onkeyup="javascript:this.value=this.value.toUpperCase()"
									required value="<?= $responsable[0]->apellidos ?>"></td>
							</tr>
							<tr>
							<!-- <select name="cbxProvincia" required
								<?php if(isset($cliente)){ echo 'disabled'; }?>>
								<option value="<?php 
								if(isset($cliente_editar)){
									if (isset($prov)){echo $prov[0]->cod_prov;}}?>" <?php if(isset($cliente)){ ?> selected
									<?php }?>><?php if(isset($cliente)){ echo $prov[0]->nombre_ubigeo; }
									elseif (isset($cliente_editar)){echo $prov[0]->nombre_ubigeo;}else{echo STR_VALOR_INICIAL;}?></option>
							</select> 
								<td><p>Tipo de Documento:</p></td>
								<td><select name="cbxDocumento" id="cbxDocumento" onchange="cambiaDocumento(this)" required>
										<option value="<?= INT_DNI?>" <?php if ($responsable[0]->tipo_documento == STR_DNI){echo 'selected';}?>><?= STR_DNI?></option>
										<option value="<?= INT_CARNET_EXTRANJERIA?>" <?php if ($responsable[0]->tipo_documento == STR_CARNET){echo 'selected';}?>><?= STR_CARNET?></option>
									</select>
								</td>
							</tr>
							<tr>
								<td><p>N° Documento:</p></td>
								<td>
									<div id="doc" class="content-1"
										style="left: 27.2%; top: 52%;">
									<input type='text' id="txtNumdoc" name='txtNumdoc' size='25'
										placeholder='Número de documento' title='Solo números'
										pattern='[0-9]{8,11}' maxlength="11"
										onkeypress="return justNumbers(event)"										
										value="<?= $responsable[0]->nro_documento?>" required/>
									</div>
								</td>
							</tr>
							<tr>
								<td><p>Fecha de Nacimiento:</p></td>
								<td><input type="date" name="dNacimiento" size="50"
									value="<?= $responsable[0]->fecha_nacimiento?>"
									max="<?php echo date('Y-m-d', strtotime('-18 year'));?>"
									required></td>
							</tr>
							<tr>
								<td><label>Dirección:</label></td>
								<td><input type="text" name="txtDireccion" size="50"
									onkeyup="javascript:this.value=this.value.toUpperCase()"
									maxlength="60" pattern="[A-Z0-9ÁÉÍÓÚÑ&Ü /*|°.]{5,60}" value="<?= $responsable[0]->direccion ?>" required></td>
							</tr>-->
							<tr>
								<td><label>Correo:</label></td>
								<td><input type="email" name="txtCorreo" size="50"
									placeholder="Ej: example@example.com"
									value="<?= $responsable[0]->correo ?>" maxlength="60"></td>
							</tr>
							<tr>
								<td><label>Celular:</label></td>
								<td><input type="text" name="txtCelular" size="50"
									placeholder="Ej: 987654321" pattern="[0-9]{9}"
									value="<?= $responsable[0]->celular ?>" maxlength="9"
									onkeypress="return justNumbers(event)"></td>
							</tr>
							<tr>
								<td><label>Teléfono:</label></td>
								<td><input type="text" name="txtTelefono" size="50"
									placeholder="Ej: 2365478" pattern="[0-9]{7}"
									value="<?= $responsable[0]->telefono ?>" maxlength="7"
									onkeypress="return justNumbers(event)"></td>
							</tr>
							<tr>
								<td colspan="2">
									<center>
										<input type="hidden" name="txtId"
											value="<?= $responsable[0]->id_solicitud_responsable ?>" /> <input
											type="submit" value="Guardar" />
									</center>
								</td>
							</tr>
						</table>
					</form>
				</div>

</body>
</html>